import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/Home.vue'
import LoginView from '../views/Login.vue'
import RegisterView from '../views/Register.vue'
import DiseaseDetail from '../views/DiseaseDetail.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', name: 'Home', component: HomeView },
    { path: '/login', name: 'Login', component: LoginView },
    { path: '/register', name: 'Register', component: RegisterView },
    { 
      path: '/disease/:diseaseId', 
      name: 'DiseaseDetail',
      component: DiseaseDetail,
      props: true
    },
    {
      path: '/message/:articleId',
      name: 'MessageDetail',
      component: () => import('../views/MessageDetail.vue')
    },
    {
      path: '/sections',
      name: 'Sections',
      component: () => import('../views/Sections.vue')
    },
    {
      path: '/doctors/:departmentId',
      name: 'Doctors',
      component: () => import('../views/DoctorList.vue')
    },
    {
      path: '/doctor/:doctorId',
      name: 'DoctorDetail',
      component: () => import('../views/DoctorDetail.vue')
    },
    {
      path: '/qa',
      name: 'QAList',
      component: () => import('../views/QAList.vue')
    },
    {
      path: '/qa/:questionId',
      name: 'QADetail',
      component: () => import('../views/QADetail.vue')
    },
    {
      path: '/disease',
      name: 'Disease',
      component: () => import('../views/Disease.vue')
    },
    {
      path: '/treat/:treatId',
      name: 'Treat',
      component: () => import('../views/Treat.vue')
    },
    {
      path: '/hospital',
      name: 'Hospital',
      component: () => import('../views/Hospital.vue')
    },
    {
      path: '/hospital/:hospitalId',
      name: 'HospitalDetail',
      component: () => import('../views/HospitalDetail.vue')
    },
    {
      path: '/examination',
      name: 'Examination',
      component: () => import('../views/Examination.vue')
    },
    {
      path: '/examination/:operationId',
      name: 'ExaminationDetail',
      component: () => import('../views/ExaminationDetail.vue')
    },
    {
      path: '/chat-Q',
      name: 'Chat-Q',
      component: () => import('../views/Chat-Q.vue')
    },
    {
      path: '/test-1',
      name: 'Test',
      component: () => import('../views/test.vue')
    },
    {
      path: '/patient',
      name: 'Patient',
      component: () => import('../views/Patient.vue')
    },
    {
      path: '/to_add',
      name: 'ToAdd',
      component: () => import('../views/ToAdd.vue')
    },
    {
      path: '/to_editor/:id',
      name: 'ToEditor',
      component: () => import('../views/ToEditor.vue')
    },
    {
      path: '/pay',
      name: 'Pay',
      component: () => import('../views/Pay.vue')
    },
    {
      path: '/coupon',
      name: 'Coupon',
      component: () => import('../views/Coupon.vue')
    },
    {
      path: '/order',
      name: 'Order',
      component: () => import('../views/Order.vue')
    },
    {
      path: '/user/order',
      name: 'UserOrder',
      component: () => import('../views/UserOrder.vue')
    },
    {
      path: '/chat-A/:doctorId',
      name: 'Chat-A',
      component: () => import('../views/Chat-A.vue')
    },
    {
      path: '/search',
      name: 'Search',
      component: () => import('../views/Search.vue')
    }
  ]
})

export default router